$(document).ready(function(){

  $(".title").change(function() {
    
    var content = $(".title").val();
    content = content.replace(/[^a-zA-Z 0-9 \- čćžšđ]+/g,'');
    content = content.replace(/(\s)/g,'-');
    content = content.replace('č','c')
    content = content.replace('ć','c')
    content = content.replace('ž','z')
    content = content.replace('š','s')
    content = content.replace('đ','d')
    content = content.toLowerCase();
    
    $(".slug").val( content );
});
});
